print("Example script zs_wuqi.lua.");

local MengJi = CLASS(Spell)
MengJi.name = '猛击'
MengJi.target = 'target'
function MengJi:canCast( )
	local nuqi = UnitPower('player');
	if nuqi > 60 then
		return true
	end
	local t = getDebuffRemainTime( 'player', '猛击' )
	return  nuqi > 30 and t == 0
end
XuanFengZhan = CLASS(Spell)
XuanFengZhan.name = '旋风斩'
function XuanFengZhan:canCast( )
	local nuqi = UnitPower('player');
	-- print('nuqi', nuqi)
	return IsSpellInRange('破胆怒吼', 'target') == 1 and nuqi > 60
	-- if nuqi > 60 then
	-- 	return true
	-- end
end
local Duanjin = CLASS(Spell)
Duanjin.name = '断筋'
Duanjin.target = 'target'

local mianyibuff = {"剑刃风暴", "自由之手", "主人的召唤"};
function Duanjin:canCast( )
	-- if getBuffRemianTime()
	for _, buff in ipairs(mianyibuff) do
		if getBuffRemianTime(self.target, buff) > 0 then
			return false
		end
	end
	local t = getDebuffRemainTime( self.target, '断筋')
	return t < 1
end
local LeiTingYiJi = CLASS(Spell)
LeiTingYiJi .name = '雷霆一击'
function LeiTingYiJi:canCast( )
	return IsSpellInRange('破胆怒吼', 'target') == 1
end

local ChongFeng = CLASS(Spell)
ChongFeng.name = '冲锋'
ChongFeng.target = 'target'
function ChongFeng:canCast( )
	local start, duration, enabled = GetSpellCooldown("英勇飞跃");
 	local dt = GetTime() - start
	return  dt > 1
end
local KuangNuHuiFu = CLASS(Spell)
KuangNuHuiFu .name = '狂怒回复'
function KuangNuHuiFu:canCast( )
	return getHpParent('player') < 0.7
end
local JiJieNaHan = CLASS(Spell)
JiJieNaHan .name = '集结呐喊'
function JiJieNaHan:canCast( )
	return getHpParent('player') < 0.3
end
local ZhanDouZiTai = CLASS(Spell)
ZhanDouZiTai.name = '战斗姿态'
ZhanDouZiTai.continue = true
function ZhanDouZiTai:canCast( )
	return IsSpellInRange('破胆怒吼', 'target') == 1
end
local FangYuZiTai = CLASS(Spell)
FangYuZiTai.name = '防御姿态'
FangYuZiTai.continue = true
function FangYuZiTai:canCast( )
	return IsSpellInRange('破胆怒吼', 'target') ~= 1
end
ZhiSiDaJi = CLASS(Spell)
ZhiSiDaJi.name = '致死打击'
ZhiSiDaJi.target = 'target'
function ZhiSiDaJi:canCast( )
	return IsSpellInRange('拳击', 'target') == 1
end
function ZhiSiDaJi:checkDistance( )
	return IsSpellInRange('拳击', 'target') == 1
end

local KuangBaoZhan = CLASS(Scheme)
-- KuangBaoZhan.follow = true
function KuangBaoZhan:ctor( )
	self:addSpell(Spell.new('乘胜追击', 'target'))
	-- self:addSpell(ZhanDouZiTai.new())
	-- self:addSpell(FangYuZiTai.new())
	self:addSpell(JiJieNaHan.new())
	self:addSpell(KuangNuHuiFu.new())
	self:addSpell(ChongFeng.new())
	self:addSpell(Spell.new('斩杀', 'target'))
	self:addSpell(Spell.new('怒击', 'target'))
	self:addSpell(Spell.new('狂风打击','target'))
	self:addSpell(Spell.new('嗜血','target'))

	self:addInterruptSpell(Spell.new('拳击', 'target'))

	self.slowSpell = Duanjin.new()
	-- self.slowSpell = LeiTingYiJi.new()
	--self:addInterruptSpell(Spell.new('风暴之锤'))
	--self:addInterruptSpell(Spell.new('法术反射'))
	--self:addInterruptSpell(Spell.new('破胆怒吼'))
end

schemeMap[12] = KuangBaoZhan.new()
